﻿using System;
using ProjectBase.Data.NHibernate;
using NHibernate;
using System.Web;


namespace SLSYJ.Helpers
{
    public class CustomWebSessionStorage : ISessionStorage
    {
        // Fields
        private const string CurrentSessionKey = "nhibernate.current_session";

        // Properties
        public ISession Session
        {
            get
            {
                HttpContext current = HttpContext.Current;
                ISession session = current.Items["nhibernate.current_session"] as ISession;
                return session;
            }
            set
            {
                HttpContext.Current.Items["nhibernate.current_session"] = value;
            }
        }
    }


}
